<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function(){
		        $("#btnSave").button({
		            icons: {
		                primary: "ui-icon-disk"
		            }
		        }).click(function(){
		        	$("#form").submit();
		        });
		        $("#btnBack").button({
		            icons: {
		                primary: "ui-icon-arrowreturnthick-1-w"
		            }
		        }).click(function(){
		        	$("#job").val("back");
		        	$("#form").submit();
		        });
			});
		</script>
	</head>
	<body>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="form" id="form" action="${pageContext.request.contextPath}/acc6" method="post">
		<input type="hidden" name="app" id="app" value="ACC60308"/>
		<input type="hidden" name="job" id="job" value="${job}"/>
		<input type="hidden" name="chqStmtKey" id="chqStmtKey" value="${chqStmtKey}"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="5"><b>${screenCode.ACC60308}</b></th>
			</tr>
			<c:if test="${!empty lsTrn || !empty lsData}">
				<tr>
					<th class="ui-state-default" width="5%"></th>
					<th class="ui-state-default">จังหวัด</th>
					<th class="ui-state-default" width="15%">วันที่สั่งจ่าย</th>
					<th class="ui-state-default" width="15%">เลขที่ cheque</th>
					<th class="ui-state-default" width="15%">จำนวนเงิน</th>
				</tr>
				<c:set var="x" value="0"/>
				<c:forEach items="${lsTrn}" var="data">
					<tr class="grid-tr-${(x+1) % 2}">
						<td align="center">
							<input type="radio" name="transactionTimestamp" id="transactionTimestamp${x}" value="${data.transactionTimestamp}|${x}"/>
						</td>
						<td>${el:getDataUtil('PAN',data.provinceId)}</td>
						<td align="center">${el:dateTh(data.chequeDate)}</td>
						<td align="center">${data.chequeNo}</td>
						<td align="right"><fmt:formatNumber pattern="#,##0.00"  value="${data.expenseAmount}"/></td>
						<input type="hidden" name="chequeReceivingDate" id="chequeReceivingDate" value="${chequeReceivingDate}"/>
						<input type="hidden" name="chequeNo" id="chequeNo" value="${data.chequeNo}"/>
						<input type="hidden" name="chequeAmount" id="chequeAmount" value="${data.expenseAmount}"/>
						<input type="hidden" name="provinceId" id="provinceId" value="${data.provinceId}"/>
					</tr>
					<c:set var="x" value="${x + 1}"/>
				</c:forEach>
				<c:forEach items="${lsData}" var="data">
					<tr class="grid-tr-${(x+1) % 2}">
						<td align="center">
							<input type="radio" name="transactionTimestamp" id="transactionTimestamp${x}" value="N|${x}"/>
						</td>
						<td>${el:getDataUtil('PAN',data.PROVINCE_ID)}</td>
						<td align="center">${el:dateTh(data.CHEQUE_DATE)}</td>
						<td align="center">${data.CHEQUE_NO}</td>
						<td align="right"><fmt:formatNumber pattern="#,##0.00"  value="${data.SUM_CHEQUE_AMOUNT}"/></td>
						<input type="hidden" name="chequeReceivingDate" id="chequeReceivingDate" value="${chequeReceivingDate}"/>
						<input type="hidden" name="chequeNo" id="chequeNo" value="${data.CHEQUE_NO}"/>
						<input type="hidden" name="chequeAmount" id="chequeAmount" value="${data.SUM_CHEQUE_AMOUNT}"/>
						<input type="hidden" name="provinceId" id="provinceId" value="${data.PROVINCE_ID}"/>
					</tr>
					<c:set var="x" value="${x + 1}"/>
				</c:forEach>
			</c:if>
				<tr>
					<td colspan="4" align="center">
						<button type="button" name="btnSave" id="btnSave" class="acc67-button">บันทึก</button>
						<button type="button" name="btnBack" id="btnBack" class="acc67-button">ย้อนกลับ</button>
					</td>
				</tr>
		</table>
		</form>
	</body>
</html>